package com.student.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * GraduateWorkUnit entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Graduate_Work_Unit", schema = "dbo", catalog = "StudentManager")
public class GraduateWorkUnit implements java.io.Serializable {

	// Fields

	private Long workUnitId;
	private TradeType tradeType;
	private String workUnitName;
	private String workUnitAddress;
	private String workUnitScale;
	private String workUnitContact;
	private String workUnitRemark;
	private Set<EmploymentSituation> employmentSituations = new HashSet<EmploymentSituation>(
			0);

	// Constructors

	/** default constructor */
	public GraduateWorkUnit() {
	}

	/** minimal constructor */
	public GraduateWorkUnit(Long workUnitId) {
		this.workUnitId = workUnitId;
	}

	/** full constructor */
	public GraduateWorkUnit(Long workUnitId, TradeType tradeType,
			String workUnitName, String workUnitAddress, String workUnitScale,
			String workUnitContact, String workUnitRemark,
			Set<EmploymentSituation> employmentSituations) {
		this.workUnitId = workUnitId;
		this.tradeType = tradeType;
		this.workUnitName = workUnitName;
		this.workUnitAddress = workUnitAddress;
		this.workUnitScale = workUnitScale;
		this.workUnitContact = workUnitContact;
		this.workUnitRemark = workUnitRemark;
		this.employmentSituations = employmentSituations;
	}

	// Property accessors
	@Id
	@Column(name = "Work_Unit_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getWorkUnitId() {
		return this.workUnitId;
	}

	public void setWorkUnitId(Long workUnitId) {
		this.workUnitId = workUnitId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Trade_Type_id")
	public TradeType getTradeType() {
		return this.tradeType;
	}

	public void setTradeType(TradeType tradeType) {
		this.tradeType = tradeType;
	}

	@Column(name = "Work_Unit_Name", length = 100)
	public String getWorkUnitName() {
		return this.workUnitName;
	}

	public void setWorkUnitName(String workUnitName) {
		this.workUnitName = workUnitName;
	}

	@Column(name = "Work_Unit_Address", length = 1024)
	public String getWorkUnitAddress() {
		return this.workUnitAddress;
	}

	public void setWorkUnitAddress(String workUnitAddress) {
		this.workUnitAddress = workUnitAddress;
	}

	@Column(name = "Work_Unit_Scale", length = 200)
	public String getWorkUnitScale() {
		return this.workUnitScale;
	}

	public void setWorkUnitScale(String workUnitScale) {
		this.workUnitScale = workUnitScale;
	}

	@Column(name = "Work_Unit_Contact", length = 50)
	public String getWorkUnitContact() {
		return this.workUnitContact;
	}

	public void setWorkUnitContact(String workUnitContact) {
		this.workUnitContact = workUnitContact;
	}

	@Column(name = "Work_Unit_Remark")
	public String getWorkUnitRemark() {
		return this.workUnitRemark;
	}

	public void setWorkUnitRemark(String workUnitRemark) {
		this.workUnitRemark = workUnitRemark;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "graduateWorkUnit")
	public Set<EmploymentSituation> getEmploymentSituations() {
		return this.employmentSituations;
	}

	public void setEmploymentSituations(
			Set<EmploymentSituation> employmentSituations) {
		this.employmentSituations = employmentSituations;
	}

}